﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TreeRenderingWithVisitor
{
    public class Tree : ITree
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public IList<ITree> Children 
        { 
            get { return _children; }
            private set { } 
        }
        public void AddChild(ITree node)
        {
            _children.Add(node);
        }

        public string Render(IRenderer renderer)
        {
            return renderer.Render(this);
        }
        private IList<ITree> _children = new List<ITree>() { };
    }
}
